package edu.cuit.svsp.controller;

import edu.cuit.svsp.request.ResponseResult;
import edu.cuit.svsp.service.ComplaintService;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @className: ComplaintController
 * @author: pjy
 * @description: 投诉控制器
 * @date: 2024/7/9
 */
@RestController
@RequestMapping("/complaint")
public class ComplaintController {
    @Resource
    private ComplaintService complaintService;

    // 投诉列表
    @GetMapping("/list/{page}/{size}")
    public ResponseResult list(@PathVariable int page, @PathVariable int size){
        return new ResponseResult(HttpStatus.OK.value(), "success", complaintService.list(page,size)) ;
    }

    //
    @DeleteMapping("/out/{id}")
    public ResponseResult out(@PathVariable("id") Integer id){

        return new ResponseResult(HttpStatus.OK.value(), "success", complaintService.out(id)) ;
    }
}
